<?php

namespace Xapi\Kernel;

use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;

class KernelServiceProvider extends ServiceProvider
{
    public function register()
    {
        //
    }

    public function boot()
    {
        $prefix = config('xapi.route.prefix', 'xapi');
        $route = $prefix . '/{module}/{action}';
        Route::any($route, 'Xapi\Kernel\RouteDispatch');
        $this->publishes([
            __DIR__ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'xapi.php' => config_path('xapi.php'),
        ], 'config');
    }
}
